/* Live account fields inside the reference access cards. */
html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) {
  min-width: 0;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) :is(.command-access-centered, .auth-card, .field, .password-control) {
  min-width: 0;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .field :is(input, select) {
  min-width: 0;
  max-width: 100%;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .reference-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .password-control {
  display: block;
  position: relative;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .password-control > input {
  padding-inline-end: 50px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .password-control > .icon-btn {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 2px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) [data-show-password] .password-hide-icon,
html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) [data-show-password][aria-pressed="true"] .password-show-icon {
  display: none;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) [data-show-password][aria-pressed="true"] .password-hide-icon {
  display: block;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .invalid-feedback {
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .invalid-feedback:empty {
  display: none;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .is-invalid {
  border-color: var(--red);
}

html[data-theme] body.auth-page[data-access-kind="register"] .command-auth-card #auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 20px;
}

html[data-theme] body.auth-page[data-access-kind="register"] #auth-form .field {
  margin: 0;
}

html[data-theme] body.auth-page[data-access-kind="register"] #auth-form > :is(.access-approval, button[type="submit"]) {
  grid-column: 1 / -1;
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-phone-control {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-phone-control > [data-register-dial-code] {
  flex-shrink: 0;
  min-width: 52px;
  padding-inline: 10px;
  text-align: center;
  color: var(--cyan);
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-phone-control > input {
  flex: 1 1 0;
  width: 0;
  border: 0;
  border-inline-start: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-phone-control:focus-within {
  border-color: var(--cyan);
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-phone-control > input.is-invalid {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-approval {
  align-items: flex-start;
  margin: 0;
}

html[data-theme] body.auth-page[data-access-kind="register"] .access-approval p {
  margin: 4px 0 0;
}

@media (min-width: 700px) {
  html[data-theme] body.auth-page[data-access-kind="register"] .command-access-centered {
    grid-template-columns: minmax(0, 1fr) minmax(0, 920px) minmax(0, 1fr);
    padding-inline: clamp(24px, 3vw, 64px);
  }

  html[data-theme] body.auth-page[data-access-kind="register"] .command-access-centered .command-auth-card {
    width: 100%;
    max-width: 920px;
  }

  html[data-theme] body.auth-page[data-access-kind="register"] .command-auth-card #auth-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 1399px) {
  html[data-theme] body.auth-page[data-access-kind="register"] .command-access-centered {
    grid-template-columns: minmax(0, 920px);
    justify-content: center;
  }

  html[data-theme] body.auth-page[data-access-kind="register"] .command-access-centered .command-auth-card {
    grid-column: 1;
  }

  html[data-theme] body.auth-page[data-access-kind="register"] :is(.command-access-quotes, .command-access-sonar) {
    display: none;
  }
}

/* Readable user access forms without oversized branding or cramped controls. */
html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .command-auth-card {
  padding: 20px clamp(18px, 2vw, 28px);
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .command-auth-card > .brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-block-end: 16px;
  text-align: start;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .command-auth-card > .brand img {
  inline-size: 52px;
  block-size: 52px;
  flex: 0 0 52px;
  object-fit: contain;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .command-auth-card > .hint {
  margin-block: 8px 16px;
  font-size: 13px;
  line-height: 1.5;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .field :is(input, select) {
  block-size: 48px;
  font-size: 16px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .field > label {
  font-size: 13px;
  line-height: 1.5;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .field > small {
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) #auth-form > button[type="submit"] {
  min-block-size: 48px;
  font-size: 14px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin-block-start: 14px;
  font-size: 13px;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .command-access-safety {
  margin-block-start: 12px;
}

/* Central feedback also needs its own layout on user access pages. */
body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) #whales-toast-container {
  position: fixed;
  inset: auto;
  inset-block-start: calc(72px + env(safe-area-inset-top, 0px));
  inset-inline-end: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: 380px;
  max-inline-size: calc(100% - 32px);
  padding: 0;
  pointer-events: none;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast {
  --toast-accent: var(--cyan, #00c3ff);
  position: relative;
  inset: auto;
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line, #24516b);
  border-inline-start: 3px solid var(--toast-accent);
  border-radius: 12px;
  background: var(--input, #061a2b);
  color: var(--text, #eaf3ff);
  box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast[data-toast-tone="danger"] {
  --toast-accent: var(--red, #ff4f64);
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast[data-toast-tone="success"] {
  --toast-accent: var(--green, #00d99a);
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-content {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px;
  align-items: start;
  gap: 10px;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-icon {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border: 1px solid var(--toast-accent);
  border-radius: 10px;
  color: var(--toast-accent);
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-icon svg {
  display: block;
  inline-size: 20px;
  block-size: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-copy {
  min-inline-size: 0;
  overflow-wrap: anywhere;
  text-align: start;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-title {
  margin-block-end: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-message {
  font-size: 13px;
  line-height: 1.5;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-close {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line, #24516b);
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-close:focus-visible {
  outline: 2px solid var(--toast-accent);
  outline-offset: 2px;
}

body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .whales-toast-progress {
  display: none;
}

html[data-theme] body.auth-page:is([data-access-kind="user-login"], [data-access-kind="admin-login"], [data-access-kind="register"]) .checkbox-label {
  min-height: 44px;
}
